﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" EnableViewStateMac="false"
    CodeFile="Item.aspx.cs" Inherits="Item" %>
<%@ Import Namespace="ThuatToan.Utils"%>

<%--<%@ Register TagPrefix="uc" TagName="SourceCodeControl" Src="~/UserControls/ThuatToan/SapXep/SapXep.ascx" %>--%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title><asp:Literal ID="literalHeader" runat="server"></asp:Literal></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">



<link type="text/css" rel="stylesheet" href="Css/Highlighter/shCore.css"></link>
<link type="text/css" rel="stylesheet" href="Css/Highlighter/shThemeDefault.css"></link>

<script language="javascript" src="Scripts/Highlighter/shCore.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushAS3.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushBash.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushColdFusion.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushCpp.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushCSharp.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushCss.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushDelphi.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushDiff.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushErlang.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushGroovy.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushJava.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushJavaFX.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushJScript.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushPerl.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushPhp.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushPlain.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushPowerShell.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushPython.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushRuby.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushScala.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushSql.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushVb.js"></script>
<script language="javascript" src="Scripts/Highlighter/shBrushXml.js"></script>


<link rel="stylesheet" href="Css/tab.css" TYPE="text/css" MEDIA="screen">

<script type="text/javascript" src="Scripts/tabber.js"></script>

<script language="javascript">
    //window.onload = function () {
//    SyntaxHighlighter.config.clipboardSwf = 'Scripts/Highlighter/clipboard.swf';
//    SyntaxHighlighter.config.strings.expandSource = 'show source';
//    SyntaxHighlighter.config.strings.viewSource = 'view source';
//    SyntaxHighlighter.config.strings.copyToClipboard = 'copy to clipboard';
//    SyntaxHighlighter.config.strings.copyToClipboardConfirmation = 'The code is in your clipboard now';
//    SyntaxHighlighter.config.strings.print = 'print';
//    SyntaxHighlighter.config.strings.help = '?';
//    SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
//    SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: ';
//    SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: ';
//    SyntaxHighlighter.defaults['pad-line-numbers'] = true;
    SyntaxHighlighter.all();

    // Tab SourceCode
    document.write('<style type="text/css">.tabber{display:none;}<\/style>');

    //}
</script>

    <style type="text/css">
        .menuTabs
        {
            position: relative;
            top: 1px;
            left: 10px;
        }
        .tab
        {
            border: Solid 1px black;
            border-bottom: none;
            padding: 0px 10px;
            background-color: #48a627;
            color: White;
            font-weight: bold;
        }
        .selectedTab
        {
            border: Solid 1px black;
            border-bottom: Solid 1px white;
            padding: 0px 10px;
            background-color: white;
            font-weight: bold;
            color: Black;
        }
        .tabBody
        {
            border: solid 1px #99d5fe;
            padding: 20px;
            background-color: white;
        }
        
        .content
        {   
            overflow-y: scroll;
        }
        
        .content p
        {
            max-height: 700px;
        }
        
        .related
        {
        	
        	border-left : Solid 1px #99d5fe;
            border-right : Solid 1px #99d5fe;
            border-bottom : Solid 1px #99d5fe;
            padding: 20px;
            background-color: white;
        	font-size:  small;
        	line-height: 150%;
        	
        }
        
        .related a
        {
        	color:#AA0000;
        }
        
           
    </style>
    <form id="form2">
    <div>
        <div class="bheading">
            <div>
                <div>
                    <div>
                        <div>
                            <div>
                                <h3>
                                    <a href="#">
                                        <asp:Label ID="lbl_Name" runat="server" Text="Label"></asp:Label>
                                    </a>
                                </h3>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
        <p>
            <asp:Menu ID="menuTabs" CssClass="menuTabs" StaticMenuItemStyle-CssClass="tab" StaticSelectedStyle-CssClass="selectedTab"
                Orientation="Horizontal" OnMenuItemClick="menuTabs_MenuItemClick" runat="server">
                <Items>
                    <asp:MenuItem Text="Mã nguồn" Value="0" Selected="true" />
                    <asp:MenuItem Text="Mô tả" Value="1" />
                    <asp:MenuItem Text="Demo" Value="2" />
                </Items>
            </asp:Menu>
            <div class="tabBody">
                <asp:MultiView ID="multiTabs" ActiveViewIndex="0" runat="server">
                    <asp:View ID="view1" runat="server">

                       <div class="tabber">

                       <% 
                          ThuatToanDAO.SourceCodeDAO source = new ThuatToanDAO.SourceCodeDAO();

                          System.Data.DataSet ds = source.ExecuteSelectFollowItemIDOrderByLanguage(itemID);

                          if (ds.Tables[0].Rows.Count == 0)
                          { %>
                              //Hiện tại chưa có mã nguồn cho thuật toán này
                       <% }
                           
                           
                          foreach (System.Data.DataRow item in ds.Tables[0].Rows)
                          { %>
                             <div class="tabbertab">
	                            <h2><%= item["Language"]%></h2>
                                    <pre class="brush: <%=item["Language"]%>;"><%= item["SourceCode"] %> 
                                    </pre>
                                    <br/>
                                    <% if (item["SourcePath"] != null && item["SourcePath"].ToString().Contains("/"))
                                        { %>
                                        <ul class="download">
                                             <li><a href="<%=item["SourcePath"] %>">Download Mã nguồn</a></li> 
                                        </ul>
                                    <% } %>
                                    <% else 
                                       {%>
                                        <% if (System.IO.File.Exists(Server.MapPath(@"SourceCodeFiles") + "\\" + item["SourcePath"]))
                                            { %>
                                            <ul class="download">
                                                <li><a href="<%="SourceCodeFiles" + "/" + item["SourcePath"] %>">Download Mã nguồn</a></li> 
                                            </ul>
                                        <% } %>
                                    <% } %>
                             </div>
                        <% } %>

                       </div>

                    </asp:View>
                    <asp:View ID="view2" runat="server">
                        <div class="description">
                        <asp:Label ID="lbl_Description" runat="server" Text="Label"></asp:Label>
                        </div>
                    </asp:View>
                    <asp:View ID="view3" runat="server">
                        <%--<uc:SourceCodeControl ID="SourceCodeControl" runat="server" />--%>
                        <asp:Label ID="lbl_MessageDemo" runat="server" Text="// Hiện tại chưa có Demo cho thuật toán này"></asp:Label>
                    </asp:View>
                </asp:MultiView>
            </div>
            </p>
        </div>

        <div>
            <div class="bheading">
            <div>
                <div>
                    <div>
                        <div>
                            <div>
                                <label class="title">
                                    Những thuật toán liên quan
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            </div>
            
            <div class="related">
             <%
                ThuatToanDAO.ItemDAO objItem = new ThuatToanDAO.ItemDAO();
                System.Data.DataSet ds = objItem.ExecuteSelectItemRelated(itemID);
                int number = 0;    
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    number++; %>
                <a href='<%= "it_" + StringUtil.Convert_Chuoi_Khong_Dau(row["Name"].ToString()) + "-" + row["ItemID"].ToString() + ".aspx" %>'><%=number%>. <%= row["Name"].ToString() %></a>
                <hr />

                <%  } %>
            </div>
        </div>
        
    </div>
    </form>
</asp:Content>
